package cn.edu.scau.cmi.ema.service.base;

import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.beans.PropertyEditorSupport;
@Component

public class CmiChangeQueryBoxNumberEditor extends PropertyEditorSupport{
	HttpServletRequest  request;
	public CmiChangeQueryBoxNumberEditor() {
	}

	public CmiChangeQueryBoxNumberEditor(HttpServletRequest  request) {
		this.request = request;
	}

	@Override
	public void setAsText(String str) {
		String  increase = request.getParameter("increase");
		String  delete = request.getParameter("delete");
		if(!(increase == null)) {
			this.setValue(increase);
		}else if(!(delete == null)) {
			this.setValue(delete);
		}else {
			this.setValue("");
		}
	}
}
